# Maintainer: Guillaume ALAUX <guillaume@archlinux.org>
_libname=jsch
pkgname=java-${_libname}
pkgver=0.1.49
pkgrel=1
pkgdesc="A pure Java implementation of SSH2"
arch=('any')
url="http://www.jcraft.com/jsch/"
license=('BSD')
depends=('java-runtime-headless')
makedepends=('apache-ant')
source=(http://downloads.sourceforge.net/project/${_libname}/${_libname}/${pkgver}/${_libname}-${pkgver}.zip)
sha256sums=('c017dfd2533b86dd751a8b1caea0ab4f19bfb9199c207c94fbdddcfd2ba9bbfe')

build() {
  cd "${srcdir}/${_libname}-${pkgver}"
  ant dist
}

package() {
  install -Dm644 ${srcdir}/${_libname}-${pkgver}/dist/lib/${_libname}-${pkgver}.jar \
                 ${pkgdir}/usr/share/java/${_libname}-${pkgver}.jar
  ln -s ${_libname}-${pkgver}.jar ${pkgdir}/usr/share/java/${_libname}.jar
  install -Dm644 ${srcdir}/${_libname}-${pkgver}/LICENSE.txt \
                 ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}
